#include "view_relax.h"
#include "display_ctrl.h"
#include "platform_assert.h"
#include "lfs_file_manager_auto.h"
#include "rtc.h"
#include "datetime.h"
#include "blecom.h"
#include "battery_ctrl.h"
#include "sport_his.h"
#include "display_interface_240x240.h"
#include "datetime.h"
#include "heart_rate_interface.h"
#include "font/num_font.h"
#include "view_common.h"
#include "Motor.h"
#include "view.h"
#include "times/view_times.h"
#include "sports_mode.h"
#include "app_trace.h"
#include "view_relax.inc"
#include "stopwatch.h"
#ifdef NO_RELAX_UI
#else
#define LOG(fmt, ...)              // app_trace_log(fmt "\r\n", ##__VA_ARGS__)
#define BREATH_INTERVAL_SECOND (4) //!< 呼吸用的时间
void view_relax_base_display(void)
{
    if (disp_ctrl.loop_cnt == 0)
    {
        disp_ctrl.auto_refresh_time = 500;
    }
    int x = 63;
    int y = 37;
    img_gif_com_t const img_cfg = {
        .gif_count = 4,
        .img[0].x = x,
        .img[0].y = y,
        .img[0].sn = FILE_IMG_D201_breathe_icon_1_63_37,
        .img[1].x = x,
        .img[1].y = y,
        .img[1].sn = FILE_IMG_D202_breathe_icon_2_63_37,
        .img[2].x = x,
        .img[2].y = y,
        .img[2].sn = FILE_IMG_D203_breathe_icon_3_63_37,
        .img[3].x = x,
        .img[3].y = y,
        .img[3].sn = FILE_IMG_D205_breathe_icon_5_63_37,
    };
    _disp_show_flash_img_gif_all(&img_cfg, DISP_LFS_FILE_INDEX_0);
    // x = 93;
    // y = 155;
    // _disp_show_flash_img(DISP_LFS_FILE_INDEX_1, x, y, FILE_IMG_D102_breathe_text_84_33);
    disp_show_localize(DISP_LFS_FILE_INDEX_1, localize_string_key_Relax, 50);
}
#ifdef EVENT_LEVEL_UP
void view_relax_option_practice_time_display(void)
{
    int x = 57;
    int y = 41;
    // _disp_show_flash_img(DISP_LFS_FILE_INDEX_0, x, y, FILE_IMG_D108_breathe_set_practicetime_57_87);
    disp_show_localize_with_x_y(DISP_LFS_FILE_INDEX_0, localize_string_key_relaxOptionTime, 50, -1, y);
    x = 171;
    y = 105;
    _disp_show_flash_img(DISP_LFS_FILE_INDEX_3, x, y, FILE_IMG_view_relax_option_time_unit);

    for (int i = 38; i < 38 + 164; i++)
    {
        disp_draw_point(i, 87, 0x528a);
        disp_draw_point(i, 135, 0x528a);
    }
    int first_index = 0;
    int second_index = 0;
    if (disp_ctrl.com_data.i_temp[0] == relax_option_time_2_min)
    {
        first_index = FILE_IMG_R115_tiem_2_115_152;
        second_index = FILE_IMG_R114_time_5_115_96;
    }
    else
    {
        second_index = FILE_IMG_R115_tiem_2_115_152;
        first_index = FILE_IMG_R114_time_5_115_96;
    }
    x = 101;
    y = 100;
    _disp_show_flash_img(DISP_LFS_FILE_INDEX_1, x, y, first_index);
    y = 156;
    _disp_show_flash_img(DISP_LFS_FILE_INDEX_2, x, y, second_index);
}
void view_relax_option_shock_display(void)
{
    // int x = 57;
    int y = 26;
    // _disp_show_flash_img(DISP_LFS_FILE_INDEX_0, x, y, FILE_IMG_D109_breathe_set_shock_57_87);
    disp_show_localize_with_x_y(DISP_LFS_FILE_INDEX_0, localize_string_key_relaxOptionShock, 50, -1, y);

    for (int i = 38; i < 38 + 164; i++)
    {
        disp_draw_point(i, 74, 0x528a);
        disp_draw_point(i, 122, 0x528a);
    }
    localize_string_key_t first_index = (localize_string_key_t)0;
    localize_string_key_t second_index = (localize_string_key_t)0;
    if (disp_ctrl.com_data.i_temp[0] == relax_option_shock_false)
    {
        first_index = localize_string_key_relaxOptionShockOff;
        second_index = localize_string_key_relaxOptionShockOn;
    }
    else
    {
        second_index = localize_string_key_relaxOptionShockOff;
        first_index = localize_string_key_relaxOptionShockOn;
    }
    // x = 83;
    y = 87;
    // _disp_show_flash_img(DISP_LFS_FILE_INDEX_1, x, y, first_index);
    disp_show_localize_with_x_y(DISP_LFS_FILE_INDEX_1, first_index, 51, -1, y);
    y = 153;
    // _disp_show_flash_img(DISP_LFS_FILE_INDEX_2, x, y, second_index);
    disp_show_localize_with_x_y(DISP_LFS_FILE_INDEX_2, second_index, 52, -1, y);
}
void view_relax_option_display(void)
{
    int x = 114;
    int y = 18;
    _disp_show_flash_img(DISP_LFS_FILE_INDEX_0, x, y, FILE_IMG_D106_breathe_set_114_18);
    for (int i = 38; i < 38 + 164; i++)
    {
        disp_draw_point(i, 74, 0x528a);
        disp_draw_point(i, 122, 0x528a);
    }
    localize_string_key_t first_index = (localize_string_key_t)0;
    localize_string_key_t second_index = (localize_string_key_t)0;
    if (disp_ctrl.com_data.i_temp[0] == 0)
    {
        first_index = localize_string_key_relaxOptionTime;
        second_index = localize_string_key_relaxOptionShock;
    }
    else
    {
        second_index = localize_string_key_relaxOptionTime;
        first_index = localize_string_key_relaxOptionShock;
    }
    x = 57;
    y = 87;
    // _disp_show_flash_img(DISP_LFS_FILE_INDEX_1, x, y, first_index);
    disp_show_localize_with_x_y(DISP_LFS_FILE_INDEX_1, first_index, 50, -1, y);
    y = 147;
    // _disp_show_flash_img(DISP_LFS_FILE_INDEX_2, x, y, second_index);
    disp_show_localize_with_x_y(DISP_LFS_FILE_INDEX_2, second_index, 51, -1, y);
}
void view_relax_home_display(void)
{
    int x = 84;
    int y = 33;
    // _disp_show_flash_img(DISP_LFS_FILE_INDEX_0, x, y, FILE_IMG_D102_breathe_text_84_33);
    disp_show_localize(DISP_LFS_FILE_INDEX_0, localize_string_key_RelaxBase, 50);
    x = 149;
    y = 32;
    // #warning debug
    //_disp_show_flash_img(DISP_LFS_FILE_INDEX_1, x, y, FILE_IMG_D101_start);
    disp_show_localize(DISP_LFS_FILE_INDEX_1, localize_string_key_relaxStartButton, 50);
    x = 28;
    y = 176;
    _disp_show_flash_img(DISP_LFS_FILE_INDEX_2, x, y, FILE_IMG_D103_set_28_176);
    x = 42;
    y = 105;
    if (disp_ctrl.com_data.i_temp[0] == relax_option_time_2_min)
    {
        // _disp_show_flash_img(DISP_LFS_FILE_INDEX_3, x, y, FILE_IMG_D104_breathe_two_42_105);
        disp_show_localize(DISP_LFS_FILE_INDEX_3, localize_string_key_relaxTips2Min, 51);
    }
    else if (disp_ctrl.com_data.i_temp[0] == relax_option_time_5_min)
    {
        // _disp_show_flash_img(DISP_LFS_FILE_INDEX_3, x, y, FILE_IMG_D103_breathe_five_42_105);
        disp_show_localize(DISP_LFS_FILE_INDEX_3, localize_string_key_relaxTips5Min, 52);
    }
}
#else  //!<#ifdef EVENT_LEVEL_UP
void view_relax_home_display(void)
{
    int x = 84;
    int y = 33;
    // _disp_show_flash_img(DISP_LFS_FILE_INDEX_0, x, y, FILE_IMG_D102_breathe_text_84_33);
    disp_show_localize(DISP_LFS_FILE_INDEX_0, localize_string_key_relaxBaseR31, 50);
    // x = 38;
    // y = 171;
    // _disp_show_flash_img(DISP_LFS_FILE_INDEX_1, x, y, FILE_IMG_D116_text_longpress_38_171);
    disp_show_localize(DISP_LFS_FILE_INDEX_1, localize_string_key_RelaxTips, 51);
    if (disp_ctrl.com_data.i_temp[0] == relax_option_time_2_min)
    {
        x = 24;
        y = 86;
        _disp_show_flash_img(DISP_LFS_FILE_INDEX_2, x, y, FILE_IMG_D113_time_2min_yes_24_86);
        x = 128;
        y = 86;
        _disp_show_flash_img(DISP_LFS_FILE_INDEX_3, x, y, FILE_IMG_D114_time_5min_no_128_86);
    }
    else if (disp_ctrl.com_data.i_temp[0] == relax_option_time_5_min)
    {
        x = 24;
        y = 86;
        _disp_show_flash_img(DISP_LFS_FILE_INDEX_2, x, y, FILE_IMG_D112_time_2min_no_24_86);
        x = 128;
        y = 86;
        _disp_show_flash_img(DISP_LFS_FILE_INDEX_3, x, y, FILE_IMG_D115_time_5min_yes_128_86);
    }
}
#endif //!<#ifdef EVENT_LEVEL_UP
void view_relax_tips_display(void)
{
    if (disp_ctrl.loop_cnt == 0)
    {
        disp_ctrl.auto_refresh_time = 1000;
        disp_ctrl.auto_close_delay = disp_ctrl.auto_refresh_time + 1000;
        if (disp_ctrl.auto_refresh_count >= 3)
        {
            display_show(view_relax_animation, DISP_MODE_NORMAL);
            return;
        }
    }
    // int x = 42;
    // int y = 97;
    // _disp_show_flash_img(DISP_LFS_FILE_INDEX_0, x, y, FILE_IMG_D105_breathe_start_42_97);
    disp_show_localize(DISP_LFS_FILE_INDEX_0, localize_string_key_RelaxStartAlert, 50);
}

int relax_animation_frame(void)
{
    uint32_t const time = stopwatch_get_catch_time(0);
    int const index = time % (BREATH_INTERVAL_SECOND * 2 * 1000);
    int animation_frame = 0; //!< 动画帧数，总是计算从小到大
    if (index < BREATH_INTERVAL_SECOND * 1000)
    {
        animation_frame = index;
    }
    else
    {
        animation_frame = BREATH_INTERVAL_SECOND * 2 * 1000 - index;
    }

    uint32_t const frame_total = sizeof(relax_animation_TAB) / sizeof(relax_animation_TAB[0]);
    int frame_index = frame_total * animation_frame / (BREATH_INTERVAL_SECOND * 1000) - 1;
    if (frame_index < 0)
    {
        return 0;
    }
    int bmp_index = relax_animation_TAB[frame_index];
    LOG("frame %d", frame_index);
    return bmp_index;
}
typedef enum __relax_tips_type_t
{
    relax_tips_type_exhale = 103,
    relax_tips_type_inhale,
} relax_tips_type_t;
relax_tips_type_t relax_animation_text_index(void)
{
    // 最小() 到最大  吸气
    // 最大到最小 呼气
    // FILE_IMG_3102_exhale 呼气
    // FILE_IMG_3107_breath_inhale 吸气
    uint32_t const time = stopwatch_get_catch_time(0);
    if (time % (BREATH_INTERVAL_SECOND * 2 * 1000) < BREATH_INTERVAL_SECOND * 1000)
    {
        return relax_tips_type_inhale;
    }
    else
    {
        return relax_tips_type_exhale;
    }
}
void view_relax_animation_display(void)
{
    if (disp_ctrl.loop_cnt == 0)
    {
        if (disp_ctrl.area_update_flag == 0)
        {
            disp_ctrl.com_data.i_temp[20] = 1;
        }
        else
        {
            disp_ctrl.com_data.i_temp[20] = 0;
        }
        disp_ctrl.auto_close_delay = 2000;
        uint32_t max_time = 0;
        if (disp_ctrl.com_data.i_temp[0] == relax_option_time_2_min)
        {
            max_time = 2 * 60 * 1000;
        }
        else
        {
            max_time = 5 * 60 * 1000;
        }
        uint32_t const time = stopwatch_get_catch_time(0);
        if (time >= max_time)
        {
            motor_start(500);
            display_show(view_relax_animation_end, DISP_MODE_NORMAL);
            return;
        }
        disp_ctrl.com_data.i_temp[2] = relax_animation_text_index();
        if (disp_ctrl.com_data.i_temp[3] != disp_ctrl.com_data.i_temp[2])
        {
            if (get_relax_option_shock() == relax_option_shock_true)
            {
                motor_start(100);
            }
            disp_ctrl.area_update_flag = 0;
        }
        else
        {
            display_set_update_area(75, 46, 90, 90);
        }
        // display_set_update_area(55, 24, 130, 130);
        disp_ctrl.com_data.i_temp[3] = disp_ctrl.com_data.i_temp[2];
        disp_ctrl.com_data.i_temp[4] = relax_animation_frame();
        disp_ctrl.auto_refresh_time = 0;
    }
    int x = 75;
    int y = 46;
    if (disp_ctrl.com_data.i_temp[4] > 0)
    {
        _disp_show_flash_img(DISP_LFS_FILE_INDEX_1, x, y, disp_ctrl.com_data.i_temp[4]);
    }

    if (disp_ctrl.com_data.i_temp[20] == 1)
    {
        if (disp_ctrl.com_data.i_temp[3] == relax_tips_type_exhale)
        {
            disp_show_localize(DISP_LFS_FILE_INDEX_0, localize_string_key_Exhale, 50);
        }
        else
        {
            disp_show_localize(DISP_LFS_FILE_INDEX_0, localize_string_key_Inhale, 50);
        }
    }
    // x = 90;
    // y = 170;
    // disp_draw_user_image(x, y, disp_ctrl.com_data.p_temp[3]);
    // _disp_show_flash_img(DISP_LFS_FILE_INDEX_0, x, y, disp_ctrl.com_data.i_temp[3]);

    //!< 一共98张图，第一张 0 ，最后一张
    // 1 1.7  16 4 最后一张 45
    // 16张第一次出现0.24      最后一张 44.94
}
void view_relax_animation_end_display(void)
{
    if (disp_ctrl.loop_cnt == 0)
    {
        disp_ctrl.auto_refresh_time = 1000;
        disp_ctrl.auto_close_delay = disp_ctrl.auto_refresh_time + 1000;
        if (disp_ctrl.auto_refresh_count >= 3)
        {
            display_show(view_relax_home, DISP_MODE_NORMAL);
            return;
        }
    }
    // int x = 0;
    // int y = 0;
#if defined(R31_BOARD)  || defined(SW03_BOARD)||defined(BOARD_L32)
    _disp_show_flash_img(DISP_LFS_FILE_INDEX_0, 0, 0, FILE_IMG_D305_end);
    disp_show_localize(DISP_LFS_FILE_INDEX_1, localize_string_key_RelaxEndAlert, 50);
#else

    disp_show_localize(DISP_LFS_FILE_INDEX_1, localize_string_key_relaxEndAlertR33, 50);
#endif
}

void view_relax_display(int view)
{
    switch (view)
    {
    case view_relax_base:
        view_relax_base_display();
        break;
    case view_relax_home:
        view_relax_home_display();
        break;
#ifdef EVENT_PREVIOUS_VIEW
    case view_relax_option:
        view_relax_option_display();
        break;
    case view_relax_option_shock:
        view_relax_option_shock_display();
        break;
    case view_relax_option_practice_time:
        view_relax_option_practice_time_display();
        break;
#endif
    case view_relax_tips:
        view_relax_tips_display();
        break;
    case view_relax_animation:
        view_relax_animation_display();
        break;
    case view_relax_animation_end:
        view_relax_animation_end_display();
        break;
    }
}
#ifdef EVENT_LEVEL_UP
view_event_result_t view_relax_option_practice_time_event(event_param_t const *param)
{
    switch (param->event)
    {
    case event_view_entry:
        disp_ctrl.com_data.i_temp[0] = get_relax_option_time();
        return view_event_result_handled;
#ifdef EVENT_LEVEL_UP
    case event_move_level_up:
        display_show(view_relax_home, DISP_MODE_NORMAL);
        return view_event_result_handled;
#endif
#ifdef EVENT_PREVIOUS_VIEW
    case event_move_previous_view:
#endif
#ifdef EVENT_NEXT_VIEW
    case event_move_next_view:
#endif
#ifdef EVENT_BUTTON_FRONT
    case event_button_front_press:
#endif
        disp_ctrl.com_data.i_temp[0] = !disp_ctrl.com_data.i_temp[0];
        display_set_update_request(view_relax_option_practice_time, 0);
        return view_event_result_handled;
#ifdef EVENT_BUTTON_FRONT
    case event_button_front_long_press:
#endif
#ifdef EVENT_LEVEL_DOWN
    case event_move_level_down:
#endif
        set_relax_option_time((relax_option_time_t)disp_ctrl.com_data.i_temp[0]);
        display_show(view_relax_home, DISP_MODE_NORMAL);
        return view_event_result_handled;
    }
    return view_event_result_not_handled;
}
view_event_result_t view_relax_option_shock_event(event_param_t const *param)
{
    switch (param->event)
    {
    case event_view_entry:
        disp_ctrl.com_data.i_temp[0] = get_relax_option_shock();
        return view_event_result_handled;
#ifdef EVENT_LEVEL_UP
    case event_move_level_up:
        display_show(view_relax_home, DISP_MODE_NORMAL);
        return view_event_result_handled;
#endif
#ifdef EVENT_PREVIOUS_VIEW
    case event_move_previous_view:
#endif
#ifdef EVENT_NEXT_VIEW
    case event_move_next_view:
#endif
#ifdef EVENT_BUTTON_FRONT
    case event_button_front_press:
#endif
        disp_ctrl.com_data.i_temp[0] = !disp_ctrl.com_data.i_temp[0];
        display_set_update_request(view_relax_option_shock, 0);
        return view_event_result_handled;
#ifdef EVENT_BUTTON_FRONT
    case event_button_front_long_press:
#endif
#ifdef EVENT_LEVEL_DOWN
    case event_move_level_down:
#endif
        set_relax_option_shock((relax_option_shock_t)disp_ctrl.com_data.i_temp[0]);
        display_show(view_relax_home, DISP_MODE_NORMAL);
        return view_event_result_handled;
    }
    return view_event_result_not_handled;
}
view_event_result_t view_relax_option_event(event_param_t const *param)
{
    switch (param->event)
    {
    case event_view_entry:
        disp_ctrl.com_data.i_temp[0] = 0;
        return view_event_result_handled;
#ifdef EVENT_PREVIOUS_VIEW
    case event_move_previous_view:
#endif
#ifdef EVENT_NEXT_VIEW
    case event_move_next_view:
#endif
#ifdef EVENT_BUTTON_FRONT
    case event_button_front_press:
#endif
        disp_ctrl.com_data.i_temp[0] = !disp_ctrl.com_data.i_temp[0];
        display_set_update_request(view_relax_option, 0);
        return view_event_result_handled;
#ifdef EVENT_BUTTON_FRONT
    case event_button_front_long_press:
#endif
#ifdef EVENT_LEVEL_DOWN
    case event_move_level_down:
#endif
        if (disp_ctrl.com_data.i_temp[0] == 0)
        {
            display_show(view_relax_option_practice_time, DISP_MODE_NORMAL);
        }
        else
        {
            display_show(view_relax_option_shock, DISP_MODE_NORMAL);
        }
        return view_event_result_handled;
#ifdef EVENT_LEVEL_UP
    case event_move_level_up:
        display_show(view_relax_home, DISP_MODE_NORMAL);
        return view_event_result_handled;
#endif
    }
    return view_event_result_not_handled;
}
view_event_result_t view_relax_home_event(event_param_t const *param)
{
    switch (param->event)
    {
    case event_view_entry:
        disp_ctrl.com_data.i_temp[0] = get_relax_option_time();
        return view_event_result_handled;
#ifdef EVENT_PREVIOUS_VIEW
    case event_move_previous_view:
        return view_event_result_handled;
#endif
#ifdef EVENT_NEXT_VIEW
    case event_move_next_view:
        display_show(view_relax_option, DISP_MODE_NORMAL);
        return view_event_result_handled;
#endif
#ifdef EVENT_LEVEL_DOWN
    case event_move_level_down:
#endif
#ifdef EVENT_BUTTON_FRONT
    case event_button_front_long_press:
#endif
        set_relax_option_time((relax_option_time_t)disp_ctrl.com_data.i_temp[0]);
        display_show(view_relax_tips, DISP_MODE_NORMAL);
        return view_event_result_handled;
#ifdef EVENT_BUTTON_FRONT
    case event_button_front_press:
#endif
        return view_event_result_handled;
    }
    return view_event_result_not_handled;
}
#else  //!<#ifdef EVENT_LEVEL_UP
view_event_result_t view_relax_home_event(event_param_t const *param)
{
    switch (param->event)
    {
    case event_view_entry:
        disp_ctrl.com_data.i_temp[0] = get_relax_option_time();
        return view_event_result_handled;
    case event_button_front_press:
        disp_ctrl.com_data.i_temp[0] = !disp_ctrl.com_data.i_temp[0];
        display_set_update_request(view_relax_home, 0);
        return view_event_result_handled;
    case event_button_front_long_press:
        set_relax_option_time((relax_option_time_t)disp_ctrl.com_data.i_temp[0]);
        display_show(view_relax_tips, DISP_MODE_NORMAL);
        return view_event_result_handled;
    }
    return view_event_result_not_handled;
}
#endif //!< #ifdef EVENT_LEVEL_UP
view_event_result_t view_relax_tips_event(event_param_t const *param)
{
    switch (param->event)
    {
#ifdef EVENT_PREVIOUS_VIEW
    case event_move_previous_view:
#endif
#ifdef EVENT_NEXT_VIEW
    case event_move_next_view:
#endif
#ifdef EVENT_LEVEL_DOWN
    case event_move_level_down:
#endif
#ifdef EVENT_BUTTON_FRONT
    case event_button_front_press:
#endif
        display_show(view_relax_animation, DISP_MODE_NORMAL);
        return view_event_result_handled;
#ifdef EVENT_LEVEL_UP
    case event_move_level_up:
#endif
#ifdef EVENT_BUTTON_FRONT
    case event_button_front_long_press:
#endif
        display_show(view_relax, DISP_MODE_NORMAL);
        return view_event_result_handled;
    }
    return view_event_result_not_handled;
}
view_event_result_t view_relax_animation_event(event_param_t const *param)
{
    switch (param->event)
    {
    case event_view_entry:
        stopwatch_start();
        disp_ctrl.com_data.i_temp[0] = get_relax_option_time();
        return view_event_result_handled;
    case event_view_exit:
        stopwatch_stop();
        return view_event_result_handled;
#ifdef EVENT_BUTTON_FRONT
    case event_button_front_press:
        return view_event_result_handled;
#endif
#ifdef EVENT_BUTTON_FRONT
    case event_button_front_long_press:
#endif
        display_show(view_relax, DISP_MODE_NORMAL);
        return view_event_result_handled;
#ifdef EVENT_LEVEL_UP
    case event_move_level_up:
        display_show(view_relax, DISP_MODE_NORMAL);
        return view_event_result_handled;
#endif
    }
    return view_event_result_not_handled;
}
view_event_result_t view_relax_animation_end_event(event_param_t const *param)
{
    switch (param->event)
    {
#ifdef EVENT_PREVIOUS_VIEW
    case event_move_previous_view:
#endif
#ifdef EVENT_NEXT_VIEW
    case event_move_next_view:
#endif
#ifdef EVENT_LEVEL_UP
    case event_move_level_up:
#endif
#ifdef EVENT_LEVEL_DOWN
    case event_move_level_down:
#endif
#ifdef EVENT_BUTTON_FRONT
    case event_button_front_press:
    case event_button_front_long_press:
#endif
        display_show(view_relax, DISP_MODE_NORMAL);
        return view_event_result_handled;
    }
    return view_event_result_not_handled;
}

view_event_result_t view_relax_event(int view, event_param_t const *param)
{
    switch (view)
    {
    case view_relax_home:
        return view_relax_home_event(param);
#ifdef EVENT_PREVIOUS_VIEW
    case view_relax_option:
        return view_relax_option_event(param);
    case view_relax_option_shock:
        return view_relax_option_shock_event(param);
    case view_relax_option_practice_time:
        return view_relax_option_practice_time_event(param);
#endif
    case view_relax_tips:
        return view_relax_tips_event(param);
    case view_relax_animation:
        return view_relax_animation_event(param);
    case view_relax_animation_end:
        return view_relax_animation_end_event(param);
    }
    return view_event_result_not_handled;
}
#endif
